#pragma once

#include "Analyzer.h"
#include "InputLine.h"
#include <iostream>
#include <string>
#include <fstream>

using namespace std;

class Parser;

class Parser {
public:
	explicit Parser(const string& filePath);
	virtual ~Parser();
	
	const string* getFilePath() const;
	virtual bool compile();
	virtual void printErrors() const;
	virtual void printVarsAndFuncs() const;
	virtual void printStat() const;
	int getNofLines() const;
	int getNofTotalToken() const;

	/*consts*/
	static const int LINE_MAX_SIZE = 100;
protected:
	
private:
	ifstream file;
	string filePath;
	list<const string *> errors;
	list<const string *> varsAndFuncs;
	list<InputLine *> lines;
	Analyze analyzer;
	// Counters
	int nofLines;
	int nofTokensInCurrentLine;
	int nofTotalToken;
};